<template>
  <div>
    <input type="text" v-model="name" />
  </div>
</template>

<script>
export default {
  data() {
    return {
      name: "",
    };
  },
  watch: {
    // newval:当前最新值
    // oldval：上一刻到的值
    name(newval, oldval) {
      console.log(newval, oldval);
    },
  },
};
</script>

<style>
</style>